package com.xuecheng.ucenter.controller;

import com.xuecheng.api.ucenter.UcenterControllerApi;
import com.xuecheng.framework.domain.ucenter.ext.XcUserExt;
import com.xuecheng.ucenter.service.XcUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/ucenter")
public class UcenterController implements UcenterControllerApi {
    @Resource
    private XcUserService xcUserService;

    /**
     * 根据用户账号,查询一个用户信息
     *
     * @param name 用户名
     * @return {@link XcUserExt}
     */
    @Override
    @GetMapping("/getUserExt")
    public XcUserExt getUserExt(@RequestParam("name") String name) {
        return xcUserService.getUserExt(name);
    }
}
